package com.jim.healio.graphrag.model;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;

import java.util.List;
import java.util.Map;
import java.util.ArrayList;
import java.util.HashMap;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class MedicalEntity {
    
    /**
     * 实体唯一标识
     */
    private String id;
    
    /**
     * 实体名称
     */
    private String name;
    
    /**
     * 实体类型：DISEASE(疾病), SYMPTOM(症状), DRUG(药物), TREATMENT(治疗方法), ORGAN(器官)
     */
    private EntityType type;
    
    /**
     * 实体描述
     */
    private String description;
    
    /**
     * 实体别名
     */
    private List<String> aliases = new ArrayList<>();
    
    /**
     * 实体属性
     */
    private Map<String, Object> properties = new HashMap<>();
    
    /**
     * 关联的文档ID列表
     */
    private List<String> documentIds = new ArrayList<>();
    
    /**
     * 置信度评分
     */
    private double confidence = 1.0;
    
    /**
     * 创建时间戳
     */
    private long createdAt = System.currentTimeMillis();
    
    /**
     * 实体类型枚举
     */
    public enum EntityType {
        DISEASE("疾病"),
        SYMPTOM("症状"), 
        DRUG("药物"),
        TREATMENT("治疗方法"),
        ORGAN("器官"),
        PROCEDURE("医疗程序"),
        RISK_FACTOR("风险因素");
        
        private final String description;
        
        EntityType(String description) {
            this.description = description;
        }
        
        public String getDescription() {
            return description;
        }
    }
    
    /**
     * 便捷构造方法
     */
    public MedicalEntity(String id, String name, EntityType type, String description) {
        this.id = id;
        this.name = name;
        this.type = type;
        this.description = description;
    }
} 